﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using GameSDK.Events;
using GameSDK.Player;

namespace GameSDK.Board
{
    /// <summary>
    /// Delegate Methods associated within a MoveEventArgs
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="eventargs"></param>
    public delegate void PlayerMovedEventHandler(object sender, MoveEventArgs eventargs);

    /// <summary>
    /// Board Class
    /// </summary>
    public abstract class StdBoard
    {
        #region Attributes

        /// <summary>
        /// List of Player in the game
        /// </summary>
        private List<StdPlayer> _listPlayer;
        public List<StdPlayer> ListPlayer
        {
            get { return _listPlayer; }
            set {  }
        }

        #endregion Attributes

        /// <summary>
        /// Event that is raised when a player move
        /// </summary>
        public event PlayerMovedEventHandler PlayerMove;

        #region Constructors        
        /// <summary>
        /// Default Constructeur
        /// </summary>
        public StdBoard()
        {
            _listPlayer = new List<StdPlayer>();
        }
        #endregion


        #region Methods

        /// <summary>
        /// Add a player in the game
        /// </summary>
        /// <param name="player">Player to add</param>
        public void AddPlayer(StdPlayer player)
        {
            _listPlayer.Add(player);
            player.GamePlayerId = _listPlayer.Count;
            player.Board = this;
        }
        
        /// <summary>
        /// Method that needs to be inplemented to instanciate a Player Move
        /// </summary>
        /// <param name="player">Player that move</param>
        /// <param name="move">Move done</param>
        public abstract void PlayerMoved(StdPlayer player, StdMove move);

        #endregion

    }
}
